import {defineAsyncComponent} from "vue";
import type {Component, DefineComponent} from "@vue/runtime-core";

export type ComponentMps = {
    name: string,
    component: Component | DefineComponent
}
/**
 * 注册全局组件
 */
const CommonComponents: Array<ComponentMps> = [
    //全局数据组件
    {"name": "app-icon", "component": defineAsyncComponent(() => import("@/components/AppIcon.vue"))},//图标组件
    {"name": "svg-icon", "component": defineAsyncComponent(() => import("@/components/SvgIcon.vue"))},//Svg图标
    {"name": "app-pagination", "component": defineAsyncComponent(() => import("@/components/AppPagination.vue"))},//数据分页组件二次封装
    {"name": "app-table", "component": defineAsyncComponent(() => import("@/components/AppTable/Index.vue"))},//数据组件二次封装
    {"name": "data-card", "component": defineAsyncComponent(() => import("@/components/DataCard.vue"))},//数据容器组件
    {"name": "data-panel", "component": defineAsyncComponent(() => import("@/components/DataPanel.vue"))},//数据展示
    {"name": "data-row", "component": defineAsyncComponent(() => import("@/components/DataRow.vue"))},//布局容器
    {"name": "json-value", "component": defineAsyncComponent(() => import("@/components/JsonValue.vue"))},//Json值获取
    {"name": "data-statistic", "component": defineAsyncComponent(() => import("@/components/DataStatistic.vue"))},//数值面板
    {"name": "preview-image", "component": defineAsyncComponent(() => import("@/components/PreviewImage.vue"))},//图片预览组价
    {"name": "data-echarts", "component": defineAsyncComponent(() => import("@/components/DataEcharts/Index.vue"))},//数据统计组件
    {"name": "data-cell", "component": defineAsyncComponent(() => import("@/components/DataCell.vue"))},//数据统计组件
    {"name": "confirm-button", "component": defineAsyncComponent(() => import("@/components/ConfirmButton.vue"))},//数据统计组件
    {"name": "show-color", "component": defineAsyncComponent(() => import("@/components/ShowColor.vue"))},//数据统计组件
    {"name": "show-html", "component": defineAsyncComponent(() => import("@/components/ShowHtml.vue"))},//数据统计组件
    {"name": "show-image-list", "component": defineAsyncComponent(() => import("@/components/ShowImageList.vue"))},//多图预览
    {"name": "app-interval", "component": defineAsyncComponent(() => import("@/components/AppInterval.vue"))},//高度占用
    {"name": "help-icon", "component": defineAsyncComponent(() => import("@/components/HelpIcon.vue"))},//帮助图标
    {"name": "highlight-text", "component": defineAsyncComponent(() => import("@/components/HighlightText.vue"))},//高亮文本
    {"name": "operate-link", "component": defineAsyncComponent(() => import("@/components/OperateLink.vue"))},//高亮文本
    {"name": "line-edit-icon", "component": defineAsyncComponent(() => import("@/components/LineEditIcon.vue"))},//高亮文本
    {"name": "detail-panel", "component": defineAsyncComponent(() => import("@/components/DetailPanel/Index.vue"))},//高亮文本

    {"name": "app-progress", "component": defineAsyncComponent(() => import("@/components/AppProgress.vue"))},//进度条组件
    {"name": "search-form", "component": defineAsyncComponent(() => import("@/components/SearchForm.vue"))},//文字显示组件
    {"name": "show-time", "component": defineAsyncComponent(() => import("@/components/ShowTime.vue"))},//时间回显
    {"name": "format-seconds", "component": defineAsyncComponent(() => import("@/components/FormatSeconds.vue"))},//时间回显
    {"name": "file-size", "component": defineAsyncComponent(() => import("@/components/FileSize.vue"))},//文件大小转换
    {"name": "file-image", "component": defineAsyncComponent(() => import("@/components/FileImage.vue"))},//File图片显示
    {"name": "divide-center", "component": defineAsyncComponent(() => import("@/components/DivideCenter.vue"))},//分割居中面板
    {"name": "show-state", "component": defineAsyncComponent(() => import("@/components/ShowState.vue"))},//分割居中面板

    //全局表单组件
    {"name": "date-range", "component": defineAsyncComponent(() => import("@/components/Form/DateRange.vue"))},//日期范围选择器
    {"name": "key-value", "component": defineAsyncComponent(() => import("@/components/Form/KeyValue.vue"))},//Key by Value表单
    {"name": "search-panel", "component": defineAsyncComponent(() => import("@/components/Form/SearchPanel/Index.vue"))},//搜索面板
    {"name": "app-switch", "component": defineAsyncComponent(() => import("@/components/Form/AppSwitch.vue"))},//状态切换
    {"name": "select-input", "component": defineAsyncComponent(() => import("@/components/Form/SelectInput.vue"))},//下拉选择框
    {"name": "image-input", "component": defineAsyncComponent(() => import("@/components/Form/ImageInput.vue"))},//图片上传组件
    {"name": "tags-input", "component": defineAsyncComponent(() => import("@/components/Form/TagsInput.vue"))},//标签输入组件
    {"name": "editor", "component": defineAsyncComponent(() => import("@/components/Form/Editor/Index.vue"))},//富文本编辑器
    {"name": "ico-choice", "component": defineAsyncComponent(() => import("@/components/Form/IcoChoice.vue"))},//图标选择器
    {"name": "app-select", "component": defineAsyncComponent(() => import("@/components/Form/AppSelect.vue"))},//接口直接选择
    {"name": "app-checkbox-group", "component": defineAsyncComponent(() => import("@/components/Form/AppCheckboxGroup.vue"))},//接口直接选择
    {"name": "integer-input", "component": defineAsyncComponent(() => import("@/components/Form/IntegerInput.vue"))},//整数输入框
    {"name": "amount-input", "component": defineAsyncComponent(() => import("@/components/Form/AmountInput.vue"))},//金额输入框
    {"name": "app-cascader", "component": defineAsyncComponent(() => import("@/components/Form/AppCascader.vue"))},//级连选择器
    {"name": "choice-map", "component": defineAsyncComponent(() => import("@/components/Form/ChoiceMap.vue"))},//地图选择器
    {"name": "radio-group", "component": defineAsyncComponent(() => import("@/components/Form/RadioGroup.vue"))},//级连选择器

    //全局其他组件
    {"name": "resource-library", "component": defineAsyncComponent(() => import("@/components/ResourceLibrary/Index.vue"))},//资源库

    //行编辑表单元素
    {"name": "line-text-input", "component": defineAsyncComponent(() => import("@/components/LineTextInput.vue"))},//资源库
    {"name": "column-select-search", "component": defineAsyncComponent(() => import("@/components/ColumnSelectSearch.vue"))},//资源库
]


// @ts-ignore
export default CommonComponents